/*
 * BSW_Boot.h
 *
 *  Created on: Oct 16, 2025
 *      Author: ADMIN
 */

#ifndef BSW_INC_BSW_BOOT_H_
#define BSW_INC_BSW_BOOT_H_

/***********************************************************************************
 ********************************************************************************
 *--------------------------------------------------------------------------
 *                            FILE DESCRIPTION
 *--------------------------------------------------------------------------
 *
 *    File Name    :     BSW_Boot.h
 *    File Module  :     BSW
 *    File Description:  This file is used to define function about BootLoad
 *
 *
 ********************************************************************************
 ***********************************************************************************/
#include "All_In_One.h"


#define MCU_FLASH_BootLoad_StartAddress   0x8000000
#define MCU_FLASH_BootLoad_Size           32*1024
#define MCU_FLASH_BootLoad_EndAddress     0x8007fff

#define MCU_FLASH_APP_StartAddress        0x8008000
#define MCU_FLASH_APP_Size                480*1024
#define MCU_FLASH_APP_EndAddress          0x807ffff

/* BootLoad StationStatus Define */
#define BOOT_STANDBY_STA    0
#define BOOT_STAYBOOT_STA   1
#define BOOT_DATEDEAL_STA   2
#define BOOT_FAULT_STA      3
#define BOOT_FLASHDEAL_STA  4
#define BOOT_JUMPAPP_STA    5
#define BOOT_INIT_STA       10

#define BOOT_CMD_LEN        8
#define BOOT_DATE_LEN       259

/* BootLoad Gloabal Parameter */
extern uint8 BSW_Boot_u8NowStatus;
extern uint8 BSW_Boot_u8LastStatus;
extern uint16 BSW_Boot_u16TotalPocketNum;
/* BootLoad Function */
void BSW_Boot_Init(void);
void BSW_Boot_main(void);
void JumpToApp(void);


void Entry_StandBy_Func(void);
void Entry_StayBoot_Func(void);
void Entry_DateDeal_Func(void);
void Entry_Fault_Func(void);
void Entry_FlashDeal_Func(void);
void Entry_JumpApp_Func(void);

void FirstEntry_StandBy_Func(void);
void FirstEntry_StayBoot_Func(void);
void FirstEntry_DateDeal_Func(void);
void FirstEntry_Fault_Func(void);
void FirstEntry_FlashDeal_Func(void);
void FirstEntry_JumpApp_Func(void);

#endif /* BSW_INC_BSW_BOOT_H_ */
